<template>
  <div class="poster-container">
    <ElImage v-if="url" :src="url" style="width: 100vw" :preview-src-list="urlList" :hide-on-click-modal="true" />
    <ElEmpty v-else>暂无图片</ElEmpty>
  </div>
</template>

<script setup lang="ts">
import { computed, ref } from "vue";
import { ElImage, ElEmpty } from "element-plus";
import { getPosterSetList } from "@/api/homePage/posterApi";

const url = ref("");
const urlList = computed(() => [url.value]);

(async () => {
  const res = await getPosterSetList();
  if (res && res.length > 0) {
    url.value = res[0].imgUrl;
  }
})();
</script>
